home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Misc Servers / Zope.exe / LET.STX < prev    next >
Encoding:
Text File  |  1999-06-30  |  1.2 KB  |  37 lines

  1. The let tag:
  2.  
  3.  is a new tag that lets you create blocks like:
  4.  
  5.  <!--#in "1,2,3,4"-->
  6.  <!--#let num=sequence-item 
  7.       index=sequence-index
  8.       result="num*index"-->
  9.  <!--#var num--> * <!--#var index--> = <!--#var result-->
  10.  <!--#/let-->
  11.  <!--#/in-->
  12.  
  13.  Which yields:
  14.  
  15.  1 * 0 = 0
  16.  2 * 1 = 2
  17.  3 * 2 = 6
  18.  4 * 3 = 12
  19.  
  20.  The #let tag works like the #with tag, but is more flexible in that
  21.  it allows you to make multiple assignments, and allows you to chain
  22.  assignments, using earlier declarations in later assignments.  Notice
  23.  inthe ablove example, the 'result' variable is based on 'num' and
  24.  'index', both of which are assigned in the same #let expression.
  25.  
  26.  Syntacticly, each argument to be evalulated in the head of the let
  27.  tag must be seperated by a newline.  Enclosing an argument in double
  28.  quotes causes it to be evaluated by the DTML expression machinery.
  29.  Un-quoted arguments are referenced by name.
  30.  
  31.  Evaluation is in sequence with the result of earlier assignments
  32.  available to later ones.  Later assignments can also override earlier
  33.  ones, which can be helpful for longer step-by-step calculations.  The
  34.  variables thus set are in effect for the life of the <!--#let-->
  35.  block.
  36.  
  37.